import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
// import eventBus from './utils/eventBus'
//引入element
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';

import Vant from 'vant';
import 'vant/lib/index.css';
Vue.use(Vant);
console.log(process.env);

// 引入axios
import "@/api/index"

// 重置样式
import "@/styles/base.less"

// 全局注册组件
import "@/components/index"

const eventBus = new Vue({
  methods: {
    emit(event, ...args) { // 发布
      this.$emit(event, ...args);
    },
    on(event, callback) { // 接收
      this.$on(event, callback);
    },
    off(event, callback) { // 销毁
      this.$off(event, callback);
    }
  }
});

Vue.config.productionTip = false
Vue.prototype.$bus = eventBus; 
Vue.use(ElementUI);
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
